Freebsd /dev/dsp: No such file or directory audio

chris (2006-05-06 16:12:58)
4659 views
0 replies
I wanted to play some music off my freebsd fileserver. It's running headless, so I just wanted to use mpg123 and rexima. First off I installed the two ports:
brezhnev# cd /usr/ports/sound/mpg123 && make install clean
brezhnev# cd /usr/ports/sound/rexima && make install clean

Now to see if it'll play some music:
brezhnev# cd ~/music
brezhnev# mpg123 track_01.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
/dev/dsp: No such file or directory
/dev/dsp: No such file or directory
/dev/dsp: No such file or directory
audio: No such file or directory

That means that it can't access my sound device. The reason for this is because I haven't told the system to load the kernel module for my sound card.. But how do I find out what model/chipset sound card I'm using? Under linux this is done using lspci, or cat /proc/pci. With freebsd you do it like this:
brezhnev# pciconf -l

....  snip ....

none1@pci0:31:5:        class=0x040100 card=0x01048086 chip=0x24c58086 rev=0x02 hdr=0x00
    vendor   = 'Intel Corporation'
    device   = '82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller'
    class    = multimedia
    subclass = audio
none2@pci1:1:0: class=0x040100 card=0x80651102 chip=0x00021102 rev=0x0a hdr=0x00
    vendor   = 'Creative Labs'
    device   = 'EMU10000 Sound Blaster Live! (Also Live! 5.1) - OEM from DELL - CT4780'
    class    = multimedia
    subclass = audio
none3@pci1:1:1: class=0x098000 card=0x00201102 chip=0x70021102 rev=0x0a hdr=0x00
    vendor   = 'Creative Labs'
    device   = 'EMU10000 Game Port'
    class    = input device

....etc....

So there it is - a Creative Labs EMU10000 Sound Blaster Live! Now to find out the name of the kernel module for this device you just have to look at the FreeBSD hardware notes and browse the 'Sound Devices' section until you find 'Soundblaster Live' - you'll find these devices listed here: http://www.freebsd.org/releases/6.0R/hardware-i386.html#SOUND. About 3/4 of the way down the page is the section:

The snd_emu10k1(4) driver supports the following sound cards:

    * Creative SoundBlaster Live! (EMU10K1 Chipset)
    * Creative SoundBlaster Audigy (EMU10K2 Chipset)
    * Creative SoundBlaster Audigy 2 (EMU10K2 Chipset)
    * Creative SoundBlaster Audigy 2 (EMU10K3 Chipset)

So we now know to load the smd_emu10k1 module. Lets do that and try it out:
brezhnev# kldload snd_emu10k1
brezhnev# mpg123 one.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Title  : One                             Artist: U2
Album  : Achtung Baby                    Year  : 1991
Comment: Created by Grip                 Genre : Rock

Playing MPEG stream from one.mp3 ...
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz stereo

That's working!

Now to get this module to load on every boot we just need to include it in the module load sequence with this command in /boot/rc.conf
snd_emu10k1_load="YES"          # Creative Sound Blaster Live

now reboot and test. I did and it works.

christo
comment